package com.ui.mine.adapter;

import android.support.annotation.Nullable;

import com.bean.ToDoBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ddd.wandemo.R;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class TodoListRvAdapter extends BaseQuickAdapter<ToDoBean.DatasBean, BaseViewHolder> {

    public TodoListRvAdapter(int layoutResId, @Nullable List<ToDoBean.DatasBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, ToDoBean.DatasBean item) {
        holder.setText(R.id.tv_todo_tile, item.getTitle())
                .setText(R.id.tv_todo_content, item.getContent())
                .setText(R.id.tv_todo_date, new SimpleDateFormat("yyyy-MM-dd").format(new Date(item.getDate())));
    }
}
